home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / fakevga.zip / FAKEVGA.ASM next >
Assembly Source File  |  1988-12-22  |  4KB  |  117 lines

  1.         NAME    FAKEVGA
  2.         TITLE   FAKEVGA -- pretent the display adapter is a VGA
  3.         PAGE    58,132
  4. ;..............................................................................
  5. ;
  6. ;       FAKEVGA pretends that the display adapter is a VGA.
  7. ;
  8. ;       Some video cards, in particular the Zenith 449, are capable of
  9. ;       a 640 by 480 16 color mode that is compatible with the VGA.
  10. ;
  11. ;       However, these cards lack the BIOS support IBM added to the PS/2
  12. ;       machines.  In particular, IBM added a function 1A, "Get or Set
  13. ;       Display Combination Code" to the BIOS video interrupt, INT 10.
  14. ;       This function is a natural way for application software to test
  15. ;       for the existance of a VGA.  If the function is not provided,
  16. ;       the software will assume that no VGA is present and will not attempt
  17. ;       to use the 640 by 480 mode.
  18. ;
  19. ;       FAKEVGA provides minimal support of function 1A, which is often
  20. ;       enough to convince an application program to use the 640 by 480
  21. ;       mode.
  22. ;
  23. ;       FAKEVGA will report to its caller that a VGA with either a
  24. ;       color or monochrome analog monitor is present.  If the
  25. ;       application program then assumes features of the display
  26. ;       adapter that are not available, the result is undefined.
  27. ;       In the case of the Zenith 449, this will happen if the program
  28. ;       attempts to use the 320 by 200 256 color mode, which is present
  29. ;       in a real VGA but not on the 449 card.
  30. ;
  31. ;       FAKEVGA does not provide any support for function 1B, "Get
  32. ;       Functionality/State Information", which is another natural
  33. ;       way to check for the presence of a VGA.  However, few programs
  34. ;       seem to use function 1B currently.
  35. ;
  36. ;       FAKEVGA is known to fool the following programs:
  37. ;
  38. ;               Wordperfect 5.0
  39. ;               Programs written using Turbo Pascal 4.0
  40. ;
  41. ;
  42. ;       Generate into a COM file as follows:
  43. ;               MASM FAKEVGA;
  44. ;               LINK FAKEVGA;
  45. ;               EXE2BIN FAKEVGA.EXE FAKEVGA.COM
  46. ;               ERASE FAKEVGA.OBJ
  47. ;               ERASE FAKEVGA.EXE
  48. ;
  49. ;
  50. ;       This program was written by myself and is hereby placed in the
  51. ;       public domain.  No warranty of any kind is expressed or implied.
  52. ;
  53. ;       Neil Erdwien
  54. ;       Computing Activities
  55. ;       Cardwell Hall
  56. ;       Kansas State University
  57. ;       Manhattan, KS  66506
  58. ;       NEIL@KSUVM  (BITNET)  or  NEIL@KSUVM.KSU.EDU  (Internet)
  59. ;       (913) 532-6311
  60. ;
  61. ;..............................................................................
  62.  
  63. cseg    SEGMENT
  64.         ASSUME  cs:cseg
  65.  
  66.         ORG     100h
  67. entry:  jmp     install
  68.         db      'FAKEVGA',0
  69.         even
  70.  
  71. oldint10 dd     0
  72. dispcode dw     8
  73.  
  74. newint10 PROC   far
  75.  
  76.         cmp     ah,1ah          ;Is this function 1A?
  77.         jne     punt            ;...if not, call the BIOS INT10
  78.  
  79.         cmp     al,00h          ;Is this a GET (AL=00) or SET (AL=01)?
  80.         mov     al,ah           ;(set AL=1A to indicate fcn supported)
  81.         jne     set
  82.  
  83.         mov     bx,dispcode     ;This is a GET request -- return the DISPCODE
  84.         iret
  85.  
  86. set:
  87.         mov     dispcode,bx     ;This is a SET request -- save the DISPCODE
  88.         iret
  89.  
  90. punt:
  91.         jmp     [oldint10]
  92.  
  93. newint10 ENDP
  94.  
  95.  
  96. install:
  97.         ASSUME  ds:cseg
  98.  
  99.         mov     ax,3510h        ;Get interrupt vector for INT 10
  100.         int     21h
  101.                                 ;ES:BX now points to the old INT 10 handler
  102.  
  103.         mov     word ptr oldint10,bx    ;...save for later use
  104.         mov     word ptr oldint10+2,es
  105.  
  106.         mov     ax,2510h        ;Set interrupt vector for INT 10
  107.         mov     dx,offset newint10
  108.         int     21h
  109.  
  110.         mov     ax,3100h                ;Stay resident, exit code = 0
  111.         mov     dx,offset install
  112.         int     21h
  113.  
  114. cseg    ENDS
  115.  
  116.         END     entry
  117.